<template>
  <!--精品热卖榜-->
    <div class="SelectHotList_wrop">
      <div class="SelectHotList_layer" v-for="(item, key) in bestList" :key = key>
        <div class="SelectHotList-img">
          <img v-lazy="item.img" alt="#">
        </div>
        <div class="SelectHotList_content">
          <p class="title">
            {{item.title}}
          </p>
          <p><span>{{item.idiom[0]}}</span>|<span>{{item.idiom[1]}}</span>|<span>{{item.idiom[2]}}</span></p>
          <span class="discountCoupon">满10减1</span>
          <p class="groupBooking">以拼<a>{{item.integer}}</a>件</p>
          <div>
            <p class=" unitPrice">￥<span class="cost">{{item.price}}</span>
              <a :href="pay[0]" @click="payment"><button>立即开拼</button></a></p>
          </div>
        </div>
      </div>
    </div>
</template>

<script>
    export default {
        name: "SelectHotList",
      data(){
          return{
            bestList:[],
            pay:[]
          }
      },
      methods:{
        getuse(){
            this.$http.get('/seller')
              .then((res) => {
                this.bestList = res.data.seller;
              })
              .catch((err) => {
                console.log(err);
              })
          },
        async payment(){
          await this.$http.get('http://localhost:9999/alipay',{ params:{
              price: 11223
            }})
            .then((res)=>{
              this.pay.push(res.data)
            })
            .catch((err)=>{
              console.log(err);
            })
        }
      },
      created() {
          this.getuse();
      }
    }
</script>

<style scoped lang="scss">
  button{
    padding: 0;
  }
  p{
    margin: 0;
  }
.SelectHotList{
  width: 100%;
  height: 100%;
  .SelectHotList_layer{
    height: 535px;
    background: white;
    box-sizing: border-box;
    padding: 30px;
    border-radius: 30px;
    margin-bottom: 30px;
    display: flex;
    .SelectHotList-img{
      height: 100%;
      width: 465px;
      margin-right: 30px;
      img{
        width: 100%;
        height: 100%;
      }
    }
    .SelectHotList_content{
      flex: 1;
      .title{
        margin: 0;
        font-size: 42px;
        line-height: 70px;
        color: #000;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2; //需要控制的文本行数
        overflow: hidden;
      }
      p{
        display: flex;
        color: #9a9a9a;
        font-size: 35px;
        line-height: 115px;
        span{
          flex: 1;
          text-align: center;
        }
        .cost{
          text-align: left;
        }
      }
      .discountCoupon{
        line-height: 50px;
        background: #fbede2;
        border-radius: 25px;
        padding: 13px 20px;
        font-size: 28px;
        color: #dc653b;
        text-align: center;
        span{
          display:inline;
        }
      }
      .unitPrice{
        display: flex;
        font-size: 30px;
        color: #ec685b;
        line-height: 70px;
        .cost{
          flex: 1;
          font-size: 50px;
        }
        button{
          display: inline-block;
          width: 215px;
          line-height: 70px;
          font-size: 35px;
          color: #fff;
          border-radius: 35px;
          border: none;
          background: linear-gradient(left,#e64044,#ec6b43);
        }
      }
    }
  }
}
</style>
